package cn.dengta.webapp.trade.model;

import cn.dengta.common.model.ValueProxy;
import cn.dengta.common.model.ValueProxyImpl;
import lombok.Getter;

/**
 * @author wxm
 * @since 2022/7/1 14:49
 */
@Getter
public enum UserCoinType implements ValueProxyImpl<UserCoinType, Integer> {
	/** 充值钻石 */
	COIN_RECHARGE(0, "充值钻"),
	/** 活动赠送钻石 */
	COIN_ADD_FREE(1, "赠送钻"),
	;

	UserCoinType(Integer value, String label) {
		this.value = value;
		this.proxy = new ValueProxy<>(this, value, label);
	}

	final ValueProxy<UserCoinType, Integer> proxy;

	public final Integer value;

	public static UserCoinType[] getValues() {
		return ValueProxy.getCachedArray(UserCoinType.class, UserCoinType::values);
	}

	public static UserCoinType of(Integer value) {
		return COIN_RECHARGE.getValueOf(value);
	}

}
